package com.gm.census.service;

import java.util.List;

/**
 * Interface defining minimum methods a service class must implement. Generic
 * enough to handle traditional and noSQL implementations. E is the Entity class
 * this service works on K is the type of the unique key identifying the class
 * entity I is the type of index used to paginate queries over the datastore
 * 
 * @author gafanhoto
 * 
 * @param <E>
 *            the entity
 * @param <K>
 *            the Id type
 */
public interface BaseService<E, K> {

	Integer DEFAULT_QUERY_PAGE = 10;

	public E find(K id);

	public E put(E e);

	public void delete(K e);

	public E get(K id);

	public List<E> list();

	public PagedListResult<List<E>> list(String index, Integer pageSize);

	public PagedListResult<List<E>> list(String index);
}
